# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VMwareEngine.V1.Model.ManagementCluster do
  @moduledoc """
  Management cluster configuration.

  ## Attributes

  *   `clusterId` (*type:* `String.t`, *default:* `nil`) - Required. The user-provided identifier of the new `Cluster`. The identifier must meet the following requirements: * Only contains 1-63 alphanumeric characters and hyphens * Begins with an alphabetical character * Ends with a non-hyphen character * Not formatted as a UUID * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
  *   `nodeTypeConfigs` (*type:* `%{optional(String.t) => GoogleApi.VMwareEngine.V1.Model.NodeTypeConfig.t}`, *default:* `nil`) - Required. The map of cluster node types in this cluster, where the key is canonical identifier of the node type (corresponds to the `NodeType`).
  *   `stretchedClusterConfig` (*type:* `GoogleApi.VMwareEngine.V1.Model.StretchedClusterConfig.t`, *default:* `nil`) - Optional. Configuration of a stretched cluster. Required for STRETCHED private clouds.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clusterId => String.t() | nil,
          :nodeTypeConfigs =>
            %{optional(String.t()) => GoogleApi.VMwareEngine.V1.Model.NodeTypeConfig.t()} | nil,
          :stretchedClusterConfig =>
            GoogleApi.VMwareEngine.V1.Model.StretchedClusterConfig.t() | nil
        }

  field(:clusterId)
  field(:nodeTypeConfigs, as: GoogleApi.VMwareEngine.V1.Model.NodeTypeConfig, type: :map)
  field(:stretchedClusterConfig, as: GoogleApi.VMwareEngine.V1.Model.StretchedClusterConfig)
end

defimpl Poison.Decoder, for: GoogleApi.VMwareEngine.V1.Model.ManagementCluster do
  def decode(value, options) do
    GoogleApi.VMwareEngine.V1.Model.ManagementCluster.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VMwareEngine.V1.Model.ManagementCluster do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
